// Windows/Error.h

#include "StdAfx.h"

#include "Error.h"

namespace Common {
namespace System {
namespace Error {

bool FormatMessage(DWORD messageID, CString &message)
{
  LPVOID msgBuf;
  if (::FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
      FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
      NULL,messageID, 0, (LPTSTR) &msgBuf,0, NULL) == 0)
    return false;
  message = (LPCTSTR)msgBuf;
  ::LocalFree(msgBuf);
  return true;
}

}}

}